//
//  fenLeiDetialCellCollectionViewCell.m
//  Experss
//
//  Created by Chen on 2017/8/3.
//  Copyright © 2017年 嗯，大葱. All rights reserved.
//

#import "fenLeiDetialCellCollectionViewCell.h"

@implementation fenLeiDetialCellCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews{
    UILabel *label = [[UILabel alloc] init];
    label.text = @"";
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont systemFontOfSize:17];
    [self addSubview:label];
    
    label.layer.cornerRadius = 5;
    
    label.clipsToBounds = YES;
    
    self.label = label;
    
}

- (void)setModel:(FenleiShaixuanSmallModel *)model{
    _model = model;
    
    self.label.text = model.name;
    
    if (model.isSelect == YES) {
        self.label.backgroundColor = RGBAColor(77, 166, 251, 1);
        self.label.textColor = [UIColor whiteColor];
    } else {
        self.label.backgroundColor = kRGB(241, 245, 250);
        self.label.textColor = [UIColor blackColor];
    }
    
}

- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.label.frame = self.bounds;
}

@end
